<template>
	<view class="">
		<uni-nav-bar left-icon="back" right-icon="back" menu="top" background-color="#000" :dark="true"  shadow @clickLeft="back"  :border="false" title="">
			<view class="w-100">
				<view class=" text-white flex align-center justify-center" style="height: 50px;">
					
					<image src="../../static/login_logo.png" class=" flex align-center justify-center" style="width: 300rpx;height: 50rpx;" mode=""></image>
					
				</view>
			</view>
		</uni-nav-bar>
		<view class="align-center justify-center w-100 " style="height: 230rpx;">
			<swiper :indicator-dots="false" :autoplay="false" >
				<swiper-item>
					<view class="bg-hei w-100" style="z-index: 2;height: 100rpx;">
						<image src="../../static/yudo-01.png" style="border-radius: 20rpx;width:90%;height: 200rpx;margin: 20rpx 5%;" mode=""></image>
					</view>
				</swiper-item>
			</swiper>
		</view>
	
		<view class="content mt-4 "  >
			<view class="flex align-center justify-start w-100 pl-4">
				<text class="bg-primary mr-2" style="width: 6rpx;height: 20rpx;"></text>
				<text class="font-sm">最近使用</text>
			</view>
			<view class="" style="height: 150rpx;" ></view>
			<block v-for="val,index in list" :key="index">
				<view class="flex align-center justify-start w-100 pl-4" style="height: 60rpx;" @click="menus(index)">
					<text class="bg-primary mr-2" style="width: 6rpx;height: 20rpx;"></text>
					<text class="font-sm">{{ val.name }}</text>
				</view>
				<view class="w-100 flex align-center justify-start" style="min-height: 150rpx;" v-if="val.xianshi" >
					<view class="flex align-center justify-center" style="width: 250rpx;" v-if="val.menu.length>0" v-for="v,i in val.menu">
						<view class="">
						<image class="flex align-center justify-center":src="v.image" style="border-radius: 50%;width: 100rpx;height: 100rpx;" mode=""></image>
						<text class="w-100 flex align-center justify-center font-small">{{ v.title }}</text>
						</view>
					</view>
				</view>
				<view class="w-100" style="height: 3rpx;background-color: #ccc;"></view>
			</block>
		</view>
		<view class="w-100">
			<uni-popup ref="popup" type="left" :animation='true' :maskClick="true" border-radius="10px 10px 0 0">
				<view class="bg-white" style="width: 475rpx;height: 100%;">
					<view class="flex  justify-start " style="background-color:#313131;height: 140px;">
						<view class="m-2 w-100 flex align-top justify-between">
							
							<image src="../../static/headDefault.jpg" mode="aspectFit" style="border-radius: 50%;width: 80rpx;height: 80rpx;"></image>
							
							<view class="">
								<uni-icons type="reload" size="20" color="#fff"></uni-icons>
							</view>
						</view>
						<view class="">
							<
							
						</view>
					</view>
					
					
				</view>
			</uni-popup>
			</view>
		
	</view>
</template>

<script>
	import $C from "@/common/config.js";
	export default {
		data() {
			return {
				title: 'Hello',
				jingying:false,
				xiaos:false,
				yewu:false,
				sheji:false,
				shengc:false,
				Lindex:10,
				list:[
					{id:1,name:'经营信息',xianshi:false,
					menu:[
						{menuID:1,image:'../../static/dayTotal_icon.png',title:'每日统计表'},
						{menuID:2,image:'../../static/salesStatus_icon.png',title:'销售统计表'},
					]},
					{id:2,name:'销售管理',xianshi:false,menu:[]},
					{id:3,name:'销售业务',xianshi:false,
					menu:[
						{menuID:3,image:'../../static/workPlan_icon.png',title:'工作计划'},
						{menuID:4,image:'../../static/zuzhuang_icon.png',title:'安装试模'},
						{menuID:5,image:'../../static/as_icon.png',title:'AS接受'},
					]},
					{id:4,name:'设计管理',xianshi:false,menu:[]},
					{id:5,name:'生产管理',xianshi:false,menu:[]},
					{id:6,name:'采购管理',xianshi:false,menu:[]},
				]
				
			}
		},
		onLoad() {
			console.log($C.url)
		},
		methods: {
			menus(index){
				for(let i=0;i<this.list.length;i++){
					this.list[i].xianshi = false
				}
				console.log(this.Lindex,index)
				if(this.Lindex == index){
					
					if(this.list[index].xianshi){
						console.log('111')
						this.list[index].xianshi = false
					}else{console.log('222')
						this.list[index].xianshi = true
						console.log(this.list[index].xianshi)
					}
					
				}else{
					if(this.list[index].xianshi){
						this.list[index].xianshi = false
					}else{
						this.list[index].xianshi = true
					}
				}
				this.Lindex =index
			},
			user(){
				
			},
			back(e){
				this.$refs.popup.open('left')
			}
		}
	}
</script>

<style>
	@import url("../../common/free.css");
	@import url("../../common/icon.css");
	
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
